package com.runshu.newsmartark.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.runshu.newsmartark.R;
import com.runshu.newsmartark.entity.WarnManagerBean;

import java.util.List;

/**
 * Demo class
 *
 * @author yu
 * @date 2020/8/27
 * @decs：
 */

public class MyWarnAdapter extends BaseQuickAdapter<WarnManagerBean.ProductListBean, BaseViewHolder> {
    public MyWarnAdapter(@Nullable List<WarnManagerBean.ProductListBean> data) {
        super(R.layout.item_warm_manager, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, WarnManagerBean.ProductListBean item) {
        helper.setText(R.id.tv_no, String.valueOf(helper.getAdapterPosition() + 1));
        helper.setText(R.id.tv_pro_name, item.getProductName());
        helper.setText(R.id.tv_pro_guige, "规格：" + item.getProductModel());
        helper.setText(R.id.tv_pro_company, "生产厂家：" + item.getManufacturer());
        helper.setText(R.id.tv_pro_num, item.getStock());
        helper.setText(R.id.tv_pro_date, "生产日期-有效期："+item.getProductTime()+"至"+item.getPeriodDate());
        helper.setText(R.id.tv_pro_warn_date, item.getWarnDateNumber());
        helper.setText(R.id.tv_pro_last_date, item.getSurplusDays());





    }
}